<template>
    <div>
        <el-row :gutter="15">
			<el-form ref="elForm" :model="dataForm" :rules="rules" size="medium" label-width="130px" label-position="right" :disabled="setting.readonly">
				<el-col :span="12" v-if="JudgeShow('opertype')">
					<el-form-item label="操作类型" prop="opertype" required >
						<el-select v-model="dataForm.opertype"  disabled  placeholder="请选择" clearable :style='{"width":"100%"}' >
							<el-option v-for="(item, index) in opertypeOptions" :key="index" :label="item.fullName" :value="item.id" ></el-option>
						</el-select>
					</el-form-item>
				</el-col>
				<el-col :span="12" v-if="JudgeShow('flowidnumber')">
					<el-form-item label="流程编码" prop="flowidnumber" >
						<el-input v-model="dataForm.flowidnumber" disabled placeholder="系统自动生成" readonly >
						</el-input>
					</el-form-item>
				</el-col>
				<el-col :span="12" v-if="JudgeShow('sbbm')">
					<el-form-item label="设备编码" prop="sbbm" required >
						<el-input v-model="dataForm.sbbm"  :disabled ="JudgeWrite('sbbm')"  placeholder="请输入危险源编码（12位）+设备类型编码(2位)+3位流水码" clearable :style='{"width":"100%"}' >
							<template slot="prepend"></template>
							<template slot="append"></template>
						</el-input>
					</el-form-item>
				</el-col>
				<el-col :span="12" v-if="JudgeShow('sszdwxydymc')">
					<el-form-item label="所属危险源名称" prop="sszdwxydymc" required>
						<el-select v-model="dataForm.sszdwxydymc"  :disabled ="JudgeWrite('sszdwxydymc')"  placeholder="请选择" clearable :style='{"width":"100%"}' >
							<el-option v-for="(item, index) in sszdwxydymcOptions" :key="index" :label="item.ZDWXYMC" :value="item.ID" ></el-option>
						</el-select>
					</el-form-item>
				</el-col>
				<el-col :span="12" v-if="JudgeShow('sbmc')">
					<el-form-item label="设备名称" prop="sbmc" required >
						<el-input v-model="dataForm.sbmc"  :disabled ="JudgeWrite('sbmc')"  placeholder="设备名称" clearable :style='{"width":"100%"}' >
							<template slot="prepend"></template>
							<template slot="append"></template>
						</el-input>
					</el-form-item>
				</el-col>
				<el-col :span="12" v-if="JudgeShow('sblx')">
					<el-form-item label="设备类型" prop="sblx" required >
						<el-select v-model="dataForm.sblx"  :disabled ="JudgeWrite('sblx')"  placeholder="设备类型" clearable :style='{"width":"100%"}' >
							<el-option v-for="(item, index) in sblxOptions" :key="index" :label="item.fullName" :value="item.id" ></el-option>
						</el-select>
					</el-form-item>
				</el-col>
				<el-col :span="12" v-if="JudgeShow('sbjz')">
					<el-form-item label="设备介质" prop="sbjz" >
						<el-input v-model="dataForm.sbjz"  :disabled ="JudgeWrite('sbjz')"  placeholder="设备介质" clearable :style='{"width":"100%"}' >
							<template slot="prepend"></template>
							<template slot="append"></template>
						</el-input>
					</el-form-item>
				</el-col>
				<el-col :span="12" v-if="JudgeShow('sbyxzt')">
					<el-form-item label="运行状态" prop="sbyxzt" required >
						<el-select v-model="dataForm.sbyxzt"  :disabled ="JudgeWrite('sbyxzt')"  placeholder="运行状态" clearable :style='{"width":"100%"}' >
							<el-option v-for="(item, index) in sbyxztOptions" :key="index" :label="item.fullName" :value="item.id" ></el-option>
						</el-select>
					</el-form-item>
				</el-col>
				<el-col :span="12" v-if="JudgeShow('sfhxcs')">
					<el-form-item label="是否核心参数" prop="sfhxcs" required >
						<el-select v-model="dataForm.sfhxcs"  :disabled ="JudgeWrite('sfhxcs')"  placeholder="是否核心参数" clearable :style='{"width":"100%"}' >
							<el-option v-for="(item, index) in sfhxcsOptions" :key="index" :label="item.fullName" :value="item.id" ></el-option>
						</el-select>
					</el-form-item>
				</el-col>
				<el-col :span="12" v-if="JudgeShow('scdylx')">
					<el-form-item label="生产单元类型" prop="scdylx" required >
						<el-select v-model="dataForm.scdylx"  :disabled ="JudgeWrite('scdylx')"  placeholder="生产单元类型" clearable :style='{"width":"100%"}' >
							<el-option v-for="(item, index) in scdylxOptions" :key="index" :label="item.MC" :value="item.ID" ></el-option>
						</el-select>
					</el-form-item>
				</el-col>
				<el-col :span="12" v-if="JudgeShow('sszzbh')">
					<el-form-item label="生产装置编号" prop="sszzbh" >
						<el-input v-model="dataForm.sszzbh"  :disabled ="JudgeWrite('sszzbh')"  placeholder="生产装置编号" clearable :style='{"width":"100%"}' >
							<template slot="prepend"></template>
							<template slot="append"></template>
						</el-input>
					</el-form-item>
				</el-col>
				<!-- <el-col :span="12" v-if="JudgeShow('jcrq')">
					<el-form-item label="采集日期" prop="jcrq" >
						<el-date-picker v-model="dataForm.jcrq"  :disabled ="JudgeWrite('jcrq')"  placeholder="请选择" clearable :style='{"width":"100%"}' type="date" format="yyyy-MM-dd" value-format="timestamp" >
						</el-date-picker>
					</el-form-item>
				</el-col> -->
				<el-col :span="12" v-if="JudgeShow('jcrq')">
					<el-form-item label="采集日期" prop="jcrq" >
						<el-date-picker v-model="dataForm.jcrq"  :disabled ="JudgeWrite('jcrq')"  placeholder="请选择" clearable :style='{"width":"100%"}' type="datetime" format="yyyy-MM-dd HH:mm:ss" value-format="timestamp" >
						</el-date-picker>
					</el-form-item>
				</el-col>
				<el-col :span="12" v-if="JudgeShow('azwz')">
					<el-form-item label="安装位置" prop="azwz" >
						<el-input v-model="dataForm.azwz"  :disabled ="JudgeWrite('azwz')"  placeholder="安装位置" clearable :style='{"width":"100%"}' >
							<template slot="prepend"></template>
							<template slot="append"></template>
						</el-input>
					</el-form-item>
				</el-col>
				<el-col :span="12" v-if="JudgeShow('position')">
					<el-form-item label="坐标" prop="position" >
						<el-input v-model="dataForm.position"  :disabled ="JudgeWrite('position')"  placeholder="坐标" clearable :style='{"width":"100%"}' >
							<template slot="prepend"></template>
							<template slot="append"></template>
						</el-input>
					</el-form-item>
				</el-col>
				<el-col :span="12" v-if="JudgeShow('aqjb')">
					<el-form-item label="安全等级" prop="aqjb" required >
						<el-select v-model="dataForm.aqjb"  :disabled ="JudgeWrite('aqjb')"  placeholder="安全等级" clearable :style='{"width":"100%"}' >
							<el-option v-for="(item, index) in aqjbOptions" :key="index" :label="item.fullName" :value="item.id" ></el-option>
						</el-select>
					</el-form-item>
				</el-col>
				<el-col :span="12" v-if="JudgeShow('sflsbj')">
					<el-form-item label="是否联锁" prop="sflsbj" required >
						<el-select v-model="dataForm.sflsbj"  :disabled ="JudgeWrite('sflsbj')"  placeholder="是否连锁" clearable :style='{"width":"100%"}' >
							<el-option v-for="(item, index) in sflsbjOptions" :key="index" :label="item.fullName" :value="item.id" ></el-option>
						</el-select>
					</el-form-item>
				</el-col>
				<el-col :span="12" v-if="JudgeShow('cjlx')">
					<el-form-item label="采集类型" prop="cjlx" required >
						<el-select v-model="dataForm.cjlx"  :disabled ="JudgeWrite('cjlx')"  placeholder="采集类型" clearable :style='{"width":"100%"}' >
							<el-option v-for="(item, index) in cjlxOptions" :key="index" :label="item.fullName" :value="item.id" ></el-option>
						</el-select>
					</el-form-item>
				</el-col>
				<el-col :span="12" v-if="JudgeShow('cjsz')">
					<el-form-item label="采集数值" prop="cjsz" >
						<el-input v-model="dataForm.cjsz"  :disabled ="JudgeWrite('cjsz')"  placeholder="采集数值" clearable :style='{"width":"100%"}' >
							<template slot="prepend"></template>
							<template slot="append"></template>
						</el-input>
					</el-form-item>
				</el-col>
				<el-col :span="12" v-if="JudgeShow('bjzt')">
					<el-form-item label="报警状态" prop="bjzt" required >
						<el-select v-model="dataForm.bjzt"  :disabled ="JudgeWrite('bjzt')"  placeholder="报警状态" clearable :style='{"width":"100%"}' >
							<el-option v-for="(item, index) in bjztOptions" :key="index" :label="item.fullName" :value="item.id" ></el-option>
						</el-select>
					</el-form-item>
				</el-col>
				<el-col :span="12" v-if="JudgeShow('jldw')">
					<el-form-item label="计量单位" prop="jldw" required >
						<el-input v-model="dataForm.jldw"  :disabled ="JudgeWrite('jldw')"  placeholder="计量单位（MPa、℃）等" clearable :style='{"width":"100%"}' >
							<template slot="prepend"></template>
							<template slot="append"></template>
						</el-input>
					</el-form-item>
				</el-col>
				<el-col :span="12" v-if="JudgeShow('lcsx')">
					<el-form-item label="量程上限" prop="lcsx" >
						<el-input v-model="dataForm.lcsx" :disabled ="JudgeWrite('lcsx')"  placeholder="量程上限" clearable :style='{"width":"100%"}' >
							<template slot="prepend"></template>
							<template slot="append"></template>
						</el-input>
					</el-form-item>
				</el-col>
				<el-col :span="12" v-if="JudgeShow('lcxx')">
					<el-form-item label="量程下限" prop="lcxx" >
						<el-input v-model="dataForm.lcxx"  :disabled ="JudgeWrite('lcxx')"  placeholder="量程下限" clearable :style='{"width":"100%"}' >
							<template slot="prepend"></template>
							<template slot="append"></template>
						</el-input>
					</el-form-item>
				</el-col>
				<el-col :span="12" v-if="JudgeShow('bjzgx')">
					<el-form-item label="报警上限" prop="bjzgx" >
						<el-input v-model="dataForm.bjzgx"  :disabled ="JudgeWrite('bjzgx')"  placeholder="报警上限" clearable :style='{"width":"100%"}' >
							<template slot="prepend"></template>
							<template slot="append"></template>
						</el-input>
					</el-form-item>
				</el-col>
				<el-col :span="12" v-if="JudgeShow('bjzggx')">
					<el-form-item label="报警上上限" prop="bjzggx" >
						<el-input v-model="dataForm.bjzggx"  :disabled ="JudgeWrite('bjzggx')"  placeholder="报警上上限" clearable :style='{"width":"100%"}' >
							<template slot="prepend"></template>
							<template slot="append"></template>
						</el-input>
					</el-form-item>
				</el-col>
				<el-col :span="12" v-if="JudgeShow('bjzdx')">
					<el-form-item label="报警下限" prop="bjzdx" >
						<el-input v-model="dataForm.bjzdx"  :disabled ="JudgeWrite('bjzdx')"  placeholder="报警下限" clearable :style='{"width":"100%"}' >
							<template slot="prepend"></template>
							<template slot="append"></template>
						</el-input>
					</el-form-item>
				</el-col>
				<el-col :span="12" v-if="JudgeShow('bjzddx')">
					<el-form-item label="报警下下限" prop="bjzddx" >
						<el-input v-model="dataForm.bjzddx"  :disabled ="JudgeWrite('bjzddx')"  placeholder="报警下下限" clearable :style='{"width":"100%"}' >
							<template slot="prepend"></template>
							<template slot="append"></template>
						</el-input>
					</el-form-item>
				</el-col>
				<el-col :span="12" v-if="JudgeShow('sydw')">
					<el-form-item label="所属单位" prop="sydw" required >
						<el-select filterable v-model="dataForm.sydw"  :disabled ="JudgeWrite('sydw')"  placeholder="所属单位" clearable :style='{"width":"100%"}' >
							<el-option v-for="(item, index) in sydwOptions" :key="index" :label="item.F_FullName" :value="item.F_Id" ></el-option>
						</el-select>
					</el-form-item>
				</el-col>
				<el-col :span="12" v-if="JudgeShow('bjms')">
					<el-form-item label="报警描述" prop="bjms" >
						<el-input v-model="dataForm.bjms"  :disabled ="JudgeWrite('bjms')"  placeholder="报警描述" clearable :style='{"width":"100%"}' >
							<template slot="prepend"></template>
							<template slot="append"></template>
						</el-input>
					</el-form-item>
				</el-col>
				<el-col :span="24" v-if="JudgeShow('sbms')">
					<el-form-item label="设备描述" prop="sbms" >
						<el-input v-model="dataForm.sbms"  :disabled ="JudgeWrite('sbms')"  placeholder="请输入" show-word-limit :style='{"width":"100%"}' type="textarea" :autosize='{"minRows":4,"maxRows":4}' >
						</el-input>
					</el-form-item>
				</el-col>
				<el-col :span="12" v-if="JudgeShow('mainid')" style="display:none;">
					<el-form-item label="主表ID" prop="mainid" >
						<el-input v-model="dataForm.mainid" disabled placeholder="主表ID" clearable :style='{"width":"100%"}' >
							<template slot="prepend"></template>
							<template slot="append"></template>
						</el-input>
					</el-form-item>
				</el-col>
			</el-form>

        </el-row>
        <UserBox v-if="userBoxVisible" ref="userBox" @submit="submit" />
    </div>
</template>
<script>
    import request from '@/utils/request'
    import { previewDataInterface } from '@/api/systemData/dataInterface'
    import { getDictionaryDataSelector } from '@/api/systemData/dictionary'
    export default {
        components: {},
        props: [],
        data() {
			//量程上限
			var checklcsx = (rule, value, callback) => {
        if (!value) {
          callback(new Error('量程上限不能为空'))
        } else {
          if (isNaN(Number(value)) == true) {
            callback(new Error('请输入数字值'));
          } else {
            if (Number(this.dataForm.lcxx) >= Number(value)) {
              callback(new Error('量程上限应该大于量程下限'));
            } else {
              callback();
            }
          }
				}
      };
			//量程下限
			var checklcxx = (rule, value, callback) => {
				if (!value) {
					callback(new Error('量程下限不能为空'))
				} else {
					if (isNaN(Number(value)) == true) {
            callback(new Error('请输入数字值'));
          } else {
						if (Number(this.dataForm.lcsx) <= Number(value)) {
							callback(new Error('量程下限应该小于量程上限'));
						} else {
							callback()
						}
					}
				}
			}
			//报警上上限(>上限)
			var checkbjzggx = (rule, value, callback) => {
				// let index = 1
				// console.log(value);
				// if (value === undefined) index = 1
				// if (isNaN(Number(value)) === true) index = 2
				// if (Number(this.dataForm.bjzgx) >= Number(value)) index = 3
				// if(index){
				// 	console.log(index);
				// 	let txt = ['报警上上限不能为空','请输入数字值','报警上上限应该大于报警上限'][index-1]
				// 	callback(new Error(txt))
				// }
				// 	callback()
				if (!value) {
					callback(new Error('报警上上限不能为空'))
				} else {
						if (isNaN(Number(value)) == true) {
            callback(new Error('请输入数字值'));
          } else {
						if (Number(this.dataForm.bjzgx) >= Number(value)) {
							callback(new Error('报警上上限应该大于报警上限'));
						} else {
							callback()
						}
					}
				}
			}
			//报警上限(<上上限，>下限)
			var checkbjzgx = (rule, value, callback) => {
				if (!value) {
					callback(new Error('报警上限不能为空'))
				} else {
					if (isNaN(Number(value)) == true) {
            callback(new Error('请输入数字值'));
          } else {
						if (Number(this.dataForm.bjzdx) >= Number(value)) {
							callback(new Error('报警上限应该大于报警下限'));
						}else if (Number(this.dataForm.bjzggx) <= Number(value)) {
							callback(new Error('报警上限应该小于报警上上限'));
						} else {
							callback()
						}
					}
				}
			}
			//报警下下限(<下限)
			var checkbjzddx = (rule, value, callback) => {
				if (!value) {
					callback(new Error('报警下下限不能为空'))
				} else {
					if (isNaN(Number(value)) == true) {
            callback(new Error('请输入数字值'));
          } else {
						if (Number(this.dataForm.bjzdx) <= Number(value)) {
							callback(new Error('报警下下限应该小于报警下限'));
						} else {
							callback()
						}
					}
				}
			}
			//报警下限(>下下限，<上限)
			var checkbjzdx = (rule, value, callback) => {
				if (!value) {
					callback(new Error('报警下限不能为空'))
				} else {
					if (isNaN(Number(value)) == true) {
            callback(new Error('请输入数字值'));
          } else {
						if (Number(this.dataForm.bjzgx) <= Number(value)) {
							callback(new Error('报警下限应该小于报警上限'));
						}else if (Number(this.dataForm.bjzddx) >= Number(value)) {
							callback(new Error('报警下限应该大于报警下下限'));
						}else {
							callback()
						}
					}
				}
			}
            return {
                visible: false,
                setting: {},
                eventType: '',
                userBoxVisible: false,
                dataForm: {
                    id:'',                    
					flowId: '',
					actionType:1,
					freeApproverUserId: '',
					opertype:'新增',
					flowidnumber:undefined,
					sbbm:undefined,
					sszdwxydymc:undefined,
					sbmc:undefined,
					sblx:undefined,
					sbjz:undefined,
					sbyxzt:"1",
					sfhxcs:"1",
					scdylx:undefined,
					sszzbh:undefined,
					jcrq:undefined,
					azwz:undefined,
					position:undefined,
					aqjb:undefined,
					sflsbj:"0",
					cjlx:undefined,
					cjsz:undefined,
					bjzt:"0",
					jldw:undefined,
					lcsx:undefined,
					lcxx:undefined,
					bjzgx:undefined,
					bjzggx:undefined,
					bjzdx:undefined,
					bjzddx:undefined,
					sydw:undefined,
					bjms:undefined,
					sbms:undefined,
					mainid:undefined,

                },
                rules: {
						opertype:[
						{
							required:true,
							message:'请输入操作类型',
							trigger:'blur'
						},
						],
						sbbm:[
						{
							required:true,
							message:'请输入设备编码',
							trigger:'blur'
						},
						],
						sszdwxydymc:[
						{
							required:true,
							message:'请输入所属危险源名称',
							trigger:'blur'
						},
						],
						sbmc:[
						{
							required:true,
							message:'请输入设备名称',
							trigger:'blur'
						},
						],
						sblx:[
						{
							required:true,
							message:'请输入设备类型',
							trigger:'blur'
						},
						],
						sbyxzt:[
						{
							required:true,
							message:'请输入运行状态',
							trigger:'blur'
						},
						],
						sfhxcs:[
						{
							required:true,
							message:'请输入是否核心参数',
							trigger:'blur'
						},
						],
						scdylx:[
						{
							required:true,
							message:'请输入生产单元类型',
							trigger:'blur'
						},
						],
						aqjb:[
						{
							required:true,
							message:'请输入安全等级',
							trigger:'blur'
						},
						],
						sflsbj:[
						{
							required:true,
							message:'请输入是否联锁',
							trigger:'blur'
						},
						],
						cjlx:[
						{
							required:true,
							message:'请输入采集类型',
							trigger:'blur'
						},
						],
						bjzt:[
						{
							required:true,
							message:'请输入报警状态',
							trigger:'blur'
						},
						],
						jldw:[
						{
							required:true,
							message:'请输入计量单位',
							trigger:'blur'
						},
						],
						sydw:[
						{
							required:true,
							message:'请输入所属单位',
							trigger:'blur'
						},
						],
						//量程上限
					  lcsx: [
							{ validator: checklcsx, trigger: 'blur' }
						],
						//量程下限
						lcxx: [
							{ validator: checklcxx, trigger: 'blur' }
						],
						//报警上上限
						bjzggx: [
							{ validator: checkbjzggx, trigger: 'blur' }
						],
						//报警上限
						bjzgx: [
							{ validator: checkbjzgx, trigger: 'blur' }
						],
						//报警下下限
						bjzddx: [
							{ validator: checkbjzddx, trigger: 'blur' }
						],
						//报警下限
						bjzdx: [
							{ validator: checkbjzdx, trigger: 'blur' }
						],

                },
				opertypeOptions:[{"fullName":"登记","id":"新增"},{"fullName":"变更","id":"编辑"},{"fullName":"删除","id":"删除"}],
				sszdwxydymcOptions:[],
				sblxOptions:[{"fullName":"温度","id":"0"},{"fullName":"压力","id":"1"},{"fullName":"液位","id":"2"},{"fullName":"流量","id":"3"},{"fullName":"ESD按钮","id":"4"},{"fullName":"可燃气体","id":"5"},{"fullName":"有毒气体","id":"6"},{"fullName":"其他","id":"7"}],
				sbyxztOptions:[{"fullName":"停用","id":"0"},{"fullName":"在用","id":"1"}],
				sfhxcsOptions:[{"fullName":"否","id":"0"},{"fullName":"是","id":"1"}],
				scdylxOptions:[],
				aqjbOptions:[{"fullName":"一级","id":"0"},{"fullName":"二级","id":"1"},{"fullName":"三级","id":"2"}],
				sflsbjOptions:[{"fullName":"是","id":"1"},{"fullName":"否","id":"0"}],
				cjlxOptions:[{"fullName":"数字量","id":"0"},{"fullName":"模拟量","id":"1"}],
				bjztOptions:[{"fullName":"正常","id":"1"},{"fullName":"报警","id":"0"}],
				sydwOptions:[],

            }
        },
        computed: {},
        watch: {},
        created() {
			this.getSszdwxydymcOptions();
			this.getScdylxOptions();
			this.getSydwOptions();

        },
        mounted() { },
        methods: {
			getSszdwxydymcOptions()
			{
				previewDataInterface('707f1102bce74818a551ebcfa88f2321').then(res => {
					this.sszdwxydymcOptions = res.data
				})
			},
			getScdylxOptions()
			{
				previewDataInterface('e7b2c31f5a7147c08629c5409dd7fdf4').then(res => {
					this.scdylxOptions = res.data
				})
			},
			getSydwOptions()
			{
				previewDataInterface('772d2cbcadd24df79243e3d92ef5f690').then(res => {
					this.sydwOptions = res.data
				})
			},

            goBack() {
                this.$emit('refresh')
            },
			init(data) {
                this.loading = true
                this.dataForm.id = data.id || ''
                this.setting = data
                this.visible = true;
                this.$nextTick(() => {
                    this.$refs['elForm'].resetFields();
                    if (this.dataForm.id) {
                        request({
                            url: '/api/WorkFlowForm/JCZBYJS/' + this.dataForm.id,
                            method: 'get'
                        }).then(res => {
                            this.dataForm = res.data

                        })
                    }else {
                        this.dataForm.flowId = data.flowId
                    }
                    this.loading = false
                })
            },
            // 表单提交
            dataFormSubmit(eventType) {
                this.$refs['elForm'].validate((valid) => {
                    if (valid) {
                        if (eventType === 'audit' || eventType === 'reject') {
                            this.$emit('approval', this.dataForm, eventType)
                            return
                         }
                        this.dataForm.actionType = eventType === 'submit' ? 0 : 1
                        this.eventType = eventType
                        if (this.eventType === 'submit') {
                            if (this.setting.freeApprover == 0) {
                                this.$confirm('您确定要提交当前流程吗, 是否继续?', '提示', {
                                    type: 'warning'
                                }).then(() => {
                                    this.submit()
                                }).catch(() => { });
                            } else {
                                this.userBoxVisible = true
                                this.$nextTick(() => {
                                    this.$refs.userBox.init()
                                })
                            }
                        } else {
                            this.request()
                        }
                    }
                })
            },
            submit(freeApproverUserId) {
                if (freeApproverUserId) this.dataForm.freeApproverUserId = freeApproverUserId
                this.request()
            },
            request() {
                if (!this.dataForm.id) {
                    delete (this.dataForm.id)
                    request({
                        url: '/api/WorkFlowForm/JCZBYJS',
                        method: 'post',
                        data: this.dataForm
                    }).then((res) => {
                        this.$message({
                            message: res.msg,
                            type: 'success',
                            duration: 1000,
                            onClose: () => {
                                this.visible = false
                                this.$emit('close', true)
                            }
                        })
                    })
                } else {
                    request({
                        url: '/api/WorkFlowForm/JCZBYJS/' + this.dataForm.id,
                        method: 'PUT',
                        data: this.dataForm
                    }).then((res) => {
                        this.$message({
                            message: res.msg,
                            type: 'success',
                            duration: 1000,
                            onClose: () => {
                                this.visible = false
                                this.$emit('close', true)
                            }
                        })
                    })
                }
            },
            JudgeShow(id) {
                if (!this.setting.formOperates || !this.setting.formOperates.length) return true
                let arr = this.setting.formOperates.filter(o => o.id === id) || []
                if (!arr.length) return true
                let item = arr[0]
                return item.read
            },
            JudgeWrite(id) {
                if (!this.setting.formOperates || !this.setting.formOperates.length) return false
                let arr = this.setting.formOperates.filter(o => o.id === id) || []
                if (!arr.length) return true
                let item = arr[0]
                return !item.write
            },

        },
    }

</script>
